#ifndef URL__H
#define URL__H
#include <map>
#include <cstring>
#include <sstream>
#include <string>
#include <vector>
#include <iostream>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <string.h>
#include <memory>
#include <regex>
#include <errno.h>
#include <set>
#include "../../Server/include/Response.h"

typedef std::shared_ptr<Response> (*function)(std::shared_ptr<RequestHead>);
struct Url{
    function fun;
    std::string url;
    Url(std::string s,function fun):fun(fun),url(s){};
    ~Url(){
        std::cout<<"Url delete...\n"<<std::endl;
    }
};


class Urls{
public:
    std::vector<std::pair<std::string,std::shared_ptr<Url>>> urls;
    std::shared_ptr<Url>& getUrl(std::string url,std::vector<std::string>& args);
    void url(std::string s,function fun);
};


extern Urls urls;

#endif